﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ProductBAL
/// </summary>
public class Product : BaseBAL
{
    CProductFacade facade = new CProductFacade();

    private int productId ;
    private int groupProductId;
    private int brandId;
    private string productName;
    private string productUnit;
    private string productImage;
    private int productPrice;
    private DateTime createdTime;
    private string productDescription;
    private string productNote;
    private string image1;
    private string image2;
    private string image3;
    private string image4;
    private int isActive;

    private string groupProductName;
    private string brandName;
    private string brandLogo;

    public int ProductId { get { return productId; } set { productId = value; } }
    public int GroupProductId { get { return groupProductId; } set { groupProductId = value; } }
    public int BrandId { get { return brandId; } set { brandId = value; } }
    public string ProductName { get { return productName; } set { productName = value; } }
    public string ProductUnit { get { return productUnit; } set { productUnit = value; } }
    public string ProductImage { get { return productImage; } set { productImage = value; } }
    public int ProductPrice { get { return productPrice; } set { productPrice = value; } }
    public DateTime CreatedTime { get { return createdTime; } set { createdTime = value; } }
    public string ProductDescription { get { return productDescription; } set { productDescription = value; } }
    public string ProductNote { get { return productNote; } set { productNote = value; } }
    public string Image1 { get { return image1; } set { image1 = value; } }
    public string Image2 { get { return image2; } set { image2 = value; } }
    public string Image3 { get { return image3; } set { image3 = value; } }
    public string Image4 { get { return image4; } set { image4 = value; } }
    public int IsActive { get { return isActive; } set { isActive = value; } }

    public string GroupProductName { get { return groupProductName; } set { groupProductName = value; } }
    public string BrandName { get { return brandName; } set { brandName = value; } }
    public string BrandLogo { get { return brandLogo; } set { brandLogo = value; } }

    public Product Detail(int productId)
    {
        return facade.Detail(productId);   
    }
    public IList<Product> List(int pageIndex, int pageMax, int groupProductId, int brandId)
    {
        return facade.List(pageIndex, pageMax, groupProductId, brandId);
    }
    public Product UpdateStatusActive(int productId, int isActive)
    {
        return facade.UpdateStatusActive(productId, isActive);
    }
    public Product Insert(string name, string unit, int price, string description, int isActive,
        int groupProductId, int brandId, string img1, string img2, string img3, string img4, string img5)
    {
        return facade.Insert(name, unit, price, description, isActive, groupProductId, brandId, img1, img2, img3, img4, img5);
    }
    public Product Update(int productid, string name, string unit, int price, string description, int isActive,
        int groupProductId, int brandId, string img1, string img2, string img3, string img4, string img5)
    {
        return facade.Update(productid, name, unit, price, description, isActive, groupProductId, brandId, img1, img2, img3, img4, img5);
    }
}